package com.juku2024.juku.db.dao

import androidx.room.*
import com.juku2024.juku.db.entity.VideoUpdateEntity

@Dao
interface VideoUpdateDao {

    @Query("SELECT * FROM videoUpdate")
    fun queryVideos():List<VideoUpdateEntity>?

    @Query("SELECT * FROM videoUpdate WHERE videoId=:id")
    fun query(id: Long):VideoUpdateEntity?

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun insert(video: VideoUpdateEntity)

    @Query("DELETE FROM videoUpdate")
    fun deleteAll()

    @Delete
    fun delete(video: VideoUpdateEntity)

    @Query("DELETE FROM videoUpdate WHERE videoId=:moveId")
    fun delete(moveId: Long)

    @Delete
    fun delete(entities: List<VideoUpdateEntity>): Int
}